package Inheritance.继承;

public class Phone2 extends Phone1 {
	public String size;
	double cpu;
	double store;
	public void use(){
		System.out.println("尺寸"+size+"cpu内存"+cpu+"内存"+store);
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(cpu);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((size == null) ? 0 : size.hashCode());
		temp = Double.doubleToLongBits(store);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Phone2 other = (Phone2) obj;
		if (Double.doubleToLongBits(cpu) != Double.doubleToLongBits(other.cpu))
			return false;
		if (size == null) {
			if (other.size != null)
				return false;
		} else if (!size.equals(other.size))
			return false;
		if (Double.doubleToLongBits(store) != Double
				.doubleToLongBits(other.store))
			return false;
		return true;
	}

}
